Category: Geeks r Us
Hi.
I'm trying to change the pixel width and height in Excel 2007, but the edit box gives a value based on the number of characters. How would you convert, say, 60 pixels into character values? Is there some kind of conversion chart or calculator for this?
If memory serves me, you can use points to pixels calculator in your VB code. Now I haven't done that in Excel, but Powerpoint has a pointsToScreenPixels. Points, aka postscript points, are the unit of measure used to measure font size/weight. So, when you see 12 point font, that is 12 points high in postscript points. If you're using the Visual basic editor for VBA (Visual Basic for Applications), you may find a similar member function under Office, or Excel. I've never done anything but math / chart-related stuff in Excel. Make sure what's being said is characters is characters, and not points first.
I had to get a sighted person to set the pixels, but sometimes it's hard to get someone who understands what they are doing. It's so much easier to auto fit than to try and figure it all out. some really smart programmer should come up with a characters to pixel converter.
I'm surprised Excel's objects don't have one, but I see what you're saying, you're doing it as a user and not via automation.
The problem with converting characters to pixels is that there is nothing fixed about a single character. In other words, it's all in the points. When I have a chance I'll do some looking and see what keyboard shortcuts are available if there are some for moving the cell or resizing it. And yes, I frequently just space things out so the formatting is fine or select multiple cells to merge, in short manage the same scenario.
You will find this especially becomes convenient as a way to do things if you write complex formulas, because each cell is an in/out variable (by reference is the technical term), and you can even name a particular cell to later reference in a formula.